package club.cearnach.entity;

import lombok.Data;

import javax.persistence.Embeddable;
import javax.persistence.JoinColumn;
import javax.persistence.OneToOne;
import java.io.Serializable;

/**
 * @author 阮胜
 * @date 2018/5/31 22:08
 */
@Data
@Embeddable
public class UserMovieId implements Serializable {
    @OneToOne
    @JoinColumn(name = "user_id")
    private User user;

    @OneToOne
    @JoinColumn(name = "movie_id")
    private Movie movie;

    public UserMovieId(User user, Movie movie) {
        this.user = user;
        this.movie = movie;
    }

    public UserMovieId() {

    }
}
